<template>
	<view class="con">
		<view class="item" v-for="(item,index) in yglist">
			<view class="title">{{index + 1}}、{{item.detailedAddress}}</view>
			<view class="bb">
				<view class="imgbox">
					<view class="bg">
						<view>TOP</view>
						<view>{{index + 1}}</view>
					</view>
					<image :src="item.avatarUrl" mode="aspectFill" class="img"></image>
				</view>
				<view>
					<view class="name">{{item.nickName | text}}</view>
					<view class="jifen">累计积分：{{item.integral}}</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	import {
		getyg
	} from "../../api/index.js"
	export default {
		components: {},
		data() {
			return {
				yglist: []
			};
		},
		filters:{
			text(val){
				let s=val.substr(0,1)
				return s+"**"
			}
		},
		// 
		onLoad(e) {
		},
		onShow() {
			this.getxg()
		},
		//下拉刷新
		onPullDownRefresh() {},
		methods: {
			// 获取最美义工
			async getxg() {
				let res = await this.get(getyg, {
					pageNum: 1,
					pageSize:10
				})
				this.yglist = res.data
			}
		}
	}
</script>

<style>
	.bg{
		width: 76rpx;
		height: 90rpx;
		/* background: #F09238; */
		background-image: url(../../static/bg/bj.png);
		background-size: 76rpx 90rpx;
		opacity: 1;
		position: absolute;
		top: 0;
		left: 0;
		z-index: 9;
		display: flex;
		flex-direction: column;
		align-items: center;
		/* justify-content: center; */
		color: #FFFFFF;
		font-size: 30rpx;
		font-weight: bold;
		line-height: 34rpx;
		padding-top: 5rpx;
	}
	.imgbox{
		width:270rpx;
		height: 270rpx;
		position: relative;
		border: 20rpx;
		overflow: hidden;
	}
	.jifen{
		font-size: 30rpx;
		font-family: PingFang SC;
		font-weight: 400;
		line-height: 42rpx;
		color: #333333;
		opacity: 1;
		margin-left: 40rpx;
	}
	.name{
		height: 45rpx;
		font-size: 32rpx;
		font-family: PingFang SC;
		font-weight: bold;
		line-height: 45rpx;
		color: #333333;
		opacity: 1;
		margin-left: 40rpx;
		margin-top: 60rpx;
	}
	.img{
		width: 270rpx;
		height: 270rpx;
		display: block;
		border-radius: 20rpx;
	}
	.bb{
		display: flex;
		margin-top: 20rpx;
	}
	.title{
		font-size: 26rpx;
		font-family: PingFang SC;
		font-weight: 400;
		line-height: 34rpx;
		color: #333333;
		opacity: 1;
	}
	.item{
		margin-bottom: 40rpx;
	}
	.con{
		padding: 0 30rpx;
	}
</style>
